package com.example.javasample.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.util.List;

/**
 * 博文
 *
 * @author Kylin
 */
@Schema(name = "博文", description = "博文对象")
@TableName("post")
@Data
@EqualsAndHashCode(callSuper = true)
public class PostDO extends BaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "博文ID")
    private Long id;

    @Schema(description = "主题")
    private String subject;

    @Schema(description = "章节")
    private String section;

    @Schema(description = "草稿")
    private String draft;

    @Schema(description = "主体")
    private String body;

    @Schema(description = "博客ID")
    private Long blogId;

    @Schema(description = "作者ID")
    private Long authorId;

    @Schema(description = "作者")
    @TableField(exist = false)
    private UserDO author;

    @Schema(description = "评论")
    private List<CommentDO> comments;

    @Schema(description = "标签")
    private List<TagDO> tags;

}
